<?php


/**
 * Notes:
 * PROJECT_NAME : ERP v1.8 重构erp
 * User: 夏鱼儿<397072174@qq.com>
 * Date: 2024/3/15
 * Time: 11:18
 */

namespace app\api\controller;

use app\admin\controller\BaseAdminController;
use think\Response;

class My extends BaseAdminController
{

    public function list(): Response
    {
        $userInfo = $this->userInfo;
        //累计下单量
        $userInfo->order_count = $userInfo->orders()->count();
        //累计下单种类量
        $userInfo->order_type_count = $userInfo->orderDetails()->group('goods_rule_id')->count();
        unset($userInfo->password);
        return $this->success('请求成功', $userInfo);
    }
}